3.2.79 \(\int \frac {A+B x}{x (a+b x)} \, dx\) [179]

Optimal. Leaf size=30 \[ \frac {A \log (x)}{a}-\frac {(A b-a B) \log (a+b x)}{a b} \]

[Out]

A*ln(x)/a-(A*b-B*a)*ln(b*x+a)/a/b

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {78} \begin {gather*} \frac {A \log (x)}{a}-\frac {(A b-a B) \log (a+b x)}{a b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(A + B*x)/(x*(a + b*x)),x]

[Out]

(A*Log[x])/a - ((A*b - a*B)*Log[a + b*x])/(a*b)

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rubi steps

\begin {align*} \int \frac {A+B x}{x (a+b x)} \, dx &=\int \left (\frac {A}{a x}+\frac {-A b+a B}{a (a+b x)}\right ) \, dx\\ &=\frac {A \log (x)}{a}-\frac {(A b-a B) \log (a+b x)}{a b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 29, normalized size = 0.97 \begin {gather*} \frac {A \log (x)}{a}+\frac {(-A b+a B) \log (a+b x)}{a b} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(A + B*x)/(x*(a + b*x)),x]

[Out]

(A*Log[x])/a + ((-(A*b) + a*B)*Log[a + b*x])/(a*b)

________________________________________________________________________________________

Maple [A]
time = 0.09, size = 30, normalized size = 1.00

method result size
default \(\frac {\left (-A b +B a \right ) \ln \left (b x +a \right )}{a b}+\frac {A \ln \left (x \right )}{a}\) \(30\)
norman \(\frac {A \ln \left (x \right )}{a}-\frac {\left (A b -B a \right ) \ln \left (b x +a \right )}{a b}\) \(31\)
risch \(-\frac {\ln \left (b x +a \right ) A}{a}+\frac {\ln \left (b x +a \right ) B}{b}+\frac {A \ln \left (-x \right )}{a}\) \(34\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*x+A)/x/(b*x+a),x,method=_RETURNVERBOSE)

[Out]

(-A*b+B*a)/a/b*ln(b*x+a)+A*ln(x)/a

________________________________________________________________________________________

Maxima [A]
time = 0.31, size = 29, normalized size = 0.97 \begin {gather*} \frac {A \log \left (x\right )}{a} + \frac {{\left (B a - A b\right )} \log \left (b x + a\right )}{a b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/x/(b*x+a),x, algorithm="maxima")

[Out]

A*log(x)/a + (B*a - A*b)*log(b*x + a)/(a*b)

________________________________________________________________________________________

Fricas [A]
time = 1.32, size = 28, normalized size = 0.93 \begin {gather*} \frac {A b \log \left (x\right ) + {\left (B a - A b\right )} \log \left (b x + a\right )}{a b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/x/(b*x+a),x, algorithm="fricas")

[Out]

(A*b*log(x) + (B*a - A*b)*log(b*x + a))/(a*b)

________________________________________________________________________________________

Sympy [A]
time = 0.22, size = 41, normalized size = 1.37 \begin {gather*} \frac {A \log {\left (x \right )}}{a} + \frac {\left (- A b + B a\right ) \log {\left (x + \frac {- A a + \frac {a \left (- A b + B a\right )}{b}}{- 2 A b + B a} \right )}}{a b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/x/(b*x+a),x)

[Out]

A*log(x)/a + (-A*b + B*a)*log(x + (-A*a + a*(-A*b + B*a)/b)/(-2*A*b + B*a))/(a*b)

________________________________________________________________________________________

Giac [A]
time = 1.00, size = 31, normalized size = 1.03 \begin {gather*} \frac {A \log \left ({\left | x \right |}\right )}{a} + \frac {{\left (B a - A b\right )} \log \left ({\left | b x + a \right |}\right )}{a b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)/x/(b*x+a),x, algorithm="giac")

[Out]

A*log(abs(x))/a + (B*a - A*b)*log(abs(b*x + a))/(a*b)

________________________________________________________________________________________

Mupad [B]
time = 0.12, size = 28, normalized size = 0.93 \begin {gather*} \frac {A\,\ln \left (x\right )}{a}-\ln \left (a+b\,x\right )\,\left (\frac {A}{a}-\frac {B}{b}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*x)/(x*(a + b*x)),x)

[Out]

(A*log(x))/a - log(a + b*x)*(A/a - B/b)

________________________________________________________________________________________